package com.tensquare.test;

import com.tensquare.test.rabbitmqtest.RabbitmqApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = RabbitmqApplication.class)
public class test {
    @Autowired
    private RabbitTemplate rabbitTemplate ;

    @Test
    public void sendMsg1(){
        rabbitTemplate.convertAndSend("itcase","往直接模式发一个消息");
    }

    @Test
    public void sendMsg2(){
        rabbitTemplate.convertAndSend("chuanzhi","","分裂模式发一个消息");
    }
/*
*   主题模式测试
*
* */
    @Test
    public void sendMsg3(){
        rabbitTemplate.convertAndSend("topic84","good.abc","主题模式发一个消息");
    }

}
